package com.smmisia.article.entity.convetor;

import com.smmisia.article.entity.ScenicSpot;
import com.smmisia.article.request.ScenicSpotUpdateRequest;
import com.smmisia.article.response.ScenicSpotResponse;
import org.mapstruct.Mapper;
import org.mapstruct.NullValueCheckStrategy;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper(nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface ScenicSpotConvertor {

    ScenicSpotConvertor INSTANCE = Mappers.getMapper(ScenicSpotConvertor.class);

    /**
     * 将请求对象转换为实体对象
     * @param request
     * @return
     */
    ScenicSpot toEntity(ScenicSpotUpdateRequest request);

    ScenicSpotResponse toResponse(ScenicSpot scenicSpot);

    List<ScenicSpotResponse> toResponseList(List<ScenicSpot> scenicSpot);
}
